import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';
import {Provider} from "react-redux";
import store from '@/redux/index';
import {ConfigProvider} from 'antd';
import {BrowserRouter} from 'react-router-dom';
import 'antd/dist/reset.css'; // Antd 5.x 版本

import './style/index.scss'

import zhCN from 'antd/locale/zh_CN'; // 引入中文包
import {AuthProvider} from './context/AuthContext';

const root = ReactDOM.createRoot(
    document.getElementById('root') as HTMLElement
);
root.render(
    // <React.StrictMode>
    <Provider store={store}>
        <BrowserRouter
            future={{v7_startTransition: true}} // 启用 v7 的行为
        >
            <AuthProvider>
                <ConfigProvider locale={zhCN}>
                    <App/>
                </ConfigProvider>
            </AuthProvider>
        </BrowserRouter>
    </Provider>
    // </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
